//
//  WifeTableViewCell.m
//  CarHome
//
//  Created by apple on 15/3/21.
//  Copyright (c) 2015年 apple. All rights reserved.
//

#import "WifeTableViewCell.h"
#import "UIImageView+WebCache.h"


@implementation WifeTableViewCell

//@property (nonatomic, retain) UIImageView *titleiImage; // 图片
//@property (nonatomic, retain) UILabel *titlelabel;
//@property (nonatomic, retain) UILabel *replycountsLabel;
//@property (nonatomic, retain) UILabel *bbsnameLabel;

- (void)dealloc
{
<<<<<<< HEAD
=======
    [_backImage release];
>>>>>>> 8bf931e2f3780ca24983ee1bdd6c2838e568d2ac
    [_data release];
    [_titleiImage release];
    [_titlelabel release];
    [_replycountsLabel release];
    [_bbsnameLabel release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
<<<<<<< HEAD

        self.titleiImage = [[UIImageView alloc] init];
        [self.contentView addSubview:self.titleiImage];
        
        self.titlelabel = [[UILabel alloc] init];
        [self.titlelabel setTextColor:[UIColor blackColor]];
        [self.titlelabel setFont:[UIFont systemFontOfSize:18]];
        self.titlelabel.numberOfLines = 0;
        [self.contentView addSubview:self.titlelabel];
        
        self.replycountsLabel = [[UILabel alloc] init];
        [self.replycountsLabel setTextColor:[UIColor blackColor]];
        [self.replycountsLabel setFont:[UIFont systemFontOfSize:18]];
        [self.contentView addSubview:self.replycountsLabel];
        
        self.bbsnameLabel = [[UILabel alloc] init];
        [self.bbsnameLabel setTextColor:[UIColor blackColor]];
        [self.bbsnameLabel setFont:[UIFont systemFontOfSize:18]];
        [self.contentView addSubview:self.bbsnameLabel];
=======
        self.backImage = [[UIImageView alloc] init];
        [self.contentView addSubview:self.backImage];
        
        
        self.titleiImage = [[UIImageView alloc] init];
        [self.backImage addSubview:self.titleiImage];
        
        self.titlelabel = [[UILabel alloc] init];
        [self.titlelabel setTextColor:[UIColor blackColor]];
        [self.titlelabel setFont:[UIFont systemFontOfSize:15]];
        [self.backImage addSubview:self.titlelabel];
        
        self.replycountsLabel = [[UILabel alloc] init];
        [self.replycountsLabel setTextColor:[UIColor blackColor]];
        [self.replycountsLabel setFont:[UIFont systemFontOfSize:15]];
        [self.backImage addSubview:self.replycountsLabel];
        
        self.bbsnameLabel = [[UILabel alloc] init];
        [self.bbsnameLabel setTextColor:[UIColor blackColor]];
        [self.bbsnameLabel setFont:[UIFont systemFontOfSize:15]];
        [self.backImage addSubview:self.bbsnameLabel];
>>>>>>> 8bf931e2f3780ca24983ee1bdd6c2838e568d2ac
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    CGFloat width = self.contentView.frame.size.width;
    CGFloat height = self.contentView.frame.size.height;
<<<<<<< HEAD

    
    self.titleiImage.frame = CGRectMake(10, 10, width - 250, height - 20);
=======
    
    self.backImage.frame = CGRectMake(0, 5, width + 35, height - 5);
    self.backImage.image = [UIImage imageNamed:@"18b1OOOPIC78.png"];
    
    
    self.titleiImage.frame = CGRectMake(0, 0, width - 250, height);
>>>>>>> 8bf931e2f3780ca24983ee1bdd6c2838e568d2ac
    NSString *str = self.data.smallpic;
    str = [str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSURL *url = [NSURL URLWithString:str];
    [self.titleiImage setImageWithURL:url];
    
<<<<<<< HEAD
    self.titlelabel.frame = CGRectMake(self.titleiImage.frame.size.width + 15, -25, width - self.titleiImage.frame.size.width, height);
    self.titlelabel.text = self.data.title;
    
    self.replycountsLabel.frame = CGRectMake(310, 40, width, height);
    NSString *replycountsStr = [NSString stringWithFormat:@"%@回", self.data.replycounts];
    self.replycountsLabel.text = replycountsStr;
    
    self.bbsnameLabel.frame = CGRectMake(self.titleiImage.frame.size.width + 15, 30, width, height);
    self.bbsnameLabel.text = self.data.bbsname;
    
=======
    self.titlelabel.frame = CGRectMake(self.titleiImage.frame.size.width, -30, width - self.titleiImage.frame.size.width, height);
    self.titlelabel.text = self.data.title;
    
    self.replycountsLabel.frame = CGRectMake(325, 40, width, height);
    NSString *replycountsStr = [NSString stringWithFormat:@"%@回", self.data.replycounts];
    self.replycountsLabel.text = replycountsStr;
    
    self.bbsnameLabel.frame = CGRectMake(self.titleiImage.frame.size.width, 40, width, height);
    self.bbsnameLabel.text = self.data.bbsname;
    
    
>>>>>>> 8bf931e2f3780ca24983ee1bdd6c2838e568d2ac
}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
